package com.aaa.entity;


import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 订单信息
 * @TableName o_order
 */
@TableName(value ="o_order")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OOrder implements Serializable {
    /**
     * 
     */
    @TableId
    private Integer id;

    /**
     * 用户id（哪个用户买的）
     */
    private String uid;

    /**
     * 订单时间
     */
    private Date orderdate;

    /**
     * 商品单价
     */
    private BigDecimal price;

    /**
     * 订单编号
     */
    private String code;

    /**
     * 0 交易成功  1 待支付 2逻辑删除  3失效订单 4取消订单
     */
    private Integer state;

    /**
     * 商家id
     */
    private String bid;

    /**
     * 是否 发货  0 未发货  1 已发货
     */
    private Integer send;

    /**
     * 是否评论 0未评论 1评论
     */
    private Integer commentstatus;

    /**
     * 商品id
     */
    private String goodsid;

    /**
     * 下单数量
     */
    private Integer num;

    /**
     * 总价
     */
    private Integer totalmoney;

    /**
     * 发货地址id
     */
    private String addrid;

    /**
     * 0微信 1支付宝
     */
    private Integer paysort;

    @TableField(exist = false)
    private UAddr uAddr;

    @TableField(exist = false)
    private UUserInfo uUserInfo;

    @TableField(exist = false)
    private GUnit gUnit;

    @TableField(exist = false)
    private  GGoods gGoods;

    @TableField(exist = false)
    private BBusinessInfo businessInfo;

    @TableField(exist = false)
    private List<OOrder> goodlist;

    public GUnit getgUnit() {
        return gUnit;
    }

    public void setgUnit(GUnit gUnit) {
        this.gUnit = gUnit;
    }

    public GGoods getgGoods() {
        return gGoods;
    }

    public void setgGoods(GGoods gGoods) {
        this.gGoods = gGoods;
    }

    public UAddr getuAddr() {
        return uAddr;
    }

    public void setuAddr(UAddr uAddr) {
        this.uAddr = uAddr;
    }

    public UUserInfo getuUserInfo() {
        return uUserInfo;
    }

    public void setuUserInfo(UUserInfo uUserInfo) {
        this.uUserInfo = uUserInfo;
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OOrder other = (OOrder) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getOrderdate() == null ? other.getOrderdate() == null : this.getOrderdate().equals(other.getOrderdate()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getBid() == null ? other.getBid() == null : this.getBid().equals(other.getBid()))
            && (this.getSend() == null ? other.getSend() == null : this.getSend().equals(other.getSend()))
            && (this.getCommentstatus() == null ? other.getCommentstatus() == null : this.getCommentstatus().equals(other.getCommentstatus()))
            && (this.getGoodsid() == null ? other.getGoodsid() == null : this.getGoodsid().equals(other.getGoodsid()))
            && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
            && (this.getTotalmoney() == null ? other.getTotalmoney() == null : this.getTotalmoney().equals(other.getTotalmoney()))
            && (this.getAddrid() == null ? other.getAddrid() == null : this.getAddrid().equals(other.getAddrid()))
            && (this.getPaysort() == null ? other.getPaysort() == null : this.getPaysort().equals(other.getPaysort()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getOrderdate() == null) ? 0 : getOrderdate().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getBid() == null) ? 0 : getBid().hashCode());
        result = prime * result + ((getSend() == null) ? 0 : getSend().hashCode());
        result = prime * result + ((getCommentstatus() == null) ? 0 : getCommentstatus().hashCode());
        result = prime * result + ((getGoodsid() == null) ? 0 : getGoodsid().hashCode());
        result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
        result = prime * result + ((getTotalmoney() == null) ? 0 : getTotalmoney().hashCode());
        result = prime * result + ((getAddrid() == null) ? 0 : getAddrid().hashCode());
        result = prime * result + ((getPaysort() == null) ? 0 : getPaysort().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", uid=").append(uid);
        sb.append(", orderdate=").append(orderdate);
        sb.append(", price=").append(price);
        sb.append(", code=").append(code);
        sb.append(", state=").append(state);
        sb.append(", bid=").append(bid);
        sb.append(", send=").append(send);
        sb.append(", commentstatus=").append(commentstatus);
        sb.append(", goodsid=").append(goodsid);
        sb.append(", num=").append(num);
        sb.append(", totalmoney=").append(totalmoney);
        sb.append(", addrid=").append(addrid);
        sb.append(", paysort=").append(paysort);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}